/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client;

/**
 *
 * @author tomek
 */
public class AddingContact {
    
    gui.AddingContactGui myGui;
    gui.UsersListGui usersListGui;
    Connection c;
    
    public AddingContact(gui.UsersListGui u) {
        myGui = new gui.AddingContactGui(this);
        usersListGui = u;
        
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                myGui.showGui();
            }
        });
    }
     
    public void sendAddRequest(String login) {
        //ms = new MsgRegistration(login);
      //  c =  new Connection(1027);
      //  int r = 0; // = c.checkLogin(ms);
//        if (r == 0) {
//            myGui.showErrorDialog();
//        }
//        else {
//            myGui.showConfirmationDialogAndDispose();
//        }
        usersListGui.getUsersVector().add(new User(login));
        usersListGui.sortList();
        usersListGui.updateList();
    }
    
    public static void main(String[] args) {
    
    }
}
